﻿using System;
using System.Windows.Forms;

namespace WinForms.NET472
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        PopoForm mForm2;

        private void button1_Click(object sender, EventArgs e)
        {
            if(mForm2 == null)
            {
                mForm2 = new PopoForm();
            }
            mForm2.ShowDialog();
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {           
            mForm2.CloseRender();
            mForm2 = null;
        }
    }
}
